#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include<algorithm>
#include<math.h>
using namespace std;

int main() {
    float a;
    char b;
    cin >> a >> b;
    int g = a - 1;
    int ans = 20 + g;
    if (a - 1 - g > 0)ans++;
    if (b == 'y')ans += 5;
    cout << ans;
    return 0;
}
